<!DOCTYPE HTML>
<html>
<head>
    <include file="Common:header_include"/>
    <title>添加默认化验单</title>
</head>
<body>
<div class="pd-20">
    <form action="{:U('add')}" method="post" class="form form-horizontal" id="form">
        <div class="row cl">
            <label class="form-label col-3"><span class="c-red">*</span>医院：</label>
            <div class="formControls col-8">
                <span class="select-box">
                <select class="select Validform_error" size="1" name="hospital_id" datatype="*" nullmsg="请选择" onchange="getdafaultlist($(this))">
                    <option value="" selected="" disabled="disabled">请选择</option>
					 <option value="-1">通用型检查单</option>
                     <volist name=":getLists(hospitalinfo)" id="v">
                        <option value="{$v['id']}">{$v['name']}</option>
                    </volist>
                </select>
                </span>
            </div>
      
        </div>
        <div class="row cl">
            <label class="form-label col-3"><span class="c-red">*</span>默认检查单:</label>
            <div class="formControls col-8">
                <span class="select-box">
                <select class="select Validform_error" size="1" name="inspectioninfo_id" id="inspectioninfo_id" datatype="*" nullmsg="请选择" >
                    <option value="" selected="" disabled="disabled">请选择</option>
                </select>
                </span>
            </div>
       
        </div>
	     <div class="row cl">
	    <label class="form-label col-3"><span class="c-red"></span>排序:</label>
            <div class="formControls col-8">
                <input type="text" class="input-text"   name="sort" value="">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-3"><span class="c-red"></span>描述：</label>
            <div class="formControls col-8">
                <textarea rows="5" cols="34" style="resize:none" class="textarea"  name="description" placeholder="请输入描述信息"></textarea>
            </div>
          
        </div>
        <div class="row cl">
            <div class="col-7 col-offset-5">
                <input class="btn btn-primary radius" type="submit" value="提交">
            </div>
        </div>
    </form>
</div>
<include file="Common:footer_include"/>
<script>
    function getdafaultlist(jqObj){
        var hospital_id = jqObj.val();
        var inspectioninfo_id = $('#inspectioninfo_id');
        var ajaxurl='{:U("DefaultInspectioninfo/getdefaultlist")}?hospital_id=' + hospital_id;
        inspectioninfo_id.html('');
        $.ajax({
            url:ajaxurl ,
            type: 'post',
            enctype: 'multipart/form-data',
            success: function (data) {
                $.each(data, function (i, items) {
                    inspectioninfo_id.append('<option value="'+ items.id + '" >'+ items.name + '</option>');
                });
            }
        });
    }
</script>
</body>
</html>